<template>
  <!-- 规则定义 分摊动因 动因详情 -->
  <div>
    <el-dialog
      v-dialogDrag
      title="查看数据"
      :visible.sync="showAgent"
      append-to-body
      width="60%"
      top="2%"
      @close="cancel"
    >
      <!-- 引入 -->
      <el-tabs type="border-card" v-model="name">
        <el-tab-pane label="基本信息"  name="0">
          <basicAgent ref="basicAgent" :driverCode="driverCode" ></basicAgent>
        </el-tab-pane>
        <el-tab-pane label="动因信息" name="1">
          <agentMsg></agentMsg>
        </el-tab-pane>
      </el-tabs>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">关闭</el-button>
        <!--  -->
      </div>
    </el-dialog>
  </div>
  <!-- 新增编辑查看弹窗 -->

  <!-- 配置层级弹窗 -->
</template>
<script>
import basicAgent from "@/components/ca/basicAgent";
import agentMsg from "@/components/ca/agentMsg";

export default {
  components: {
    basicAgent,
    agentMsg,
  },
  props: {
    driverCode: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      showAgent: false,
      name:"0"
    };
  },
  created() {},
  methods: {
    // 获取回显的数据
    // 取消
    init() {
      this.showAgent = true;
      this.name = "0"
      setTimeout(()=>{
      this.$refs.basicAgent.init()
      })
      //
    },
    cancel() {
      this.showAgent = false;
    },
  },
};
</script>
<style lang="scss" scoped>
</style>